<?php

namespace app\admin\validate;

use think\Validate;
use app\common\Error;

class OfficialAccounts extends Validate
{
    protected $rule = [
        'id' => 'require',
        'name' => 'require',
        'app_id' => 'require',
        'app_secret' => 'require',
        'token' => 'require',
        'original_id' => 'require',
        'encoding_aes_key' => 'require',
        'company_id' => 'require',
        'applet_id' => 'require',
        'is_default' => 'require',
    ];

    protected $message = [
        'id.require' => Error::ID_NOT_EXIXTS,
        'name.require' => Error::NAME_NOT_EXIXTS,
        'app_id.require' => Error::APP_ID_NOT_EXIXTS,
        'app_secret.require' => Error::APP_SECRET_NOT_EXIXTS,
        'token.require' => Error::TOKEN_NOT_EXIXTS,
        'original_id.require' => Error::ORIGINAL_ID_NOT_EXIXTS,
        'encoding_aes_key.require' => Error::ENCODING_AES_KEY_NOT_EXIXTS,
        'company_id.require' => Error::COMPANY_ID_NOT_EXIXTS,
        'applet_id.require' => Error::APPLET_ID_NOT_EXIXTS,
        'is_default.require' => Error::IS_DEFAULT_NOT_EXIXTS,
    ];

    protected $scene = [
        'add' => ['name', 'app_id', 'app_secret', 'token', 'original_id', 'encoding_aes_key', 'company_id', 'applet_id', 'is_default'],
        'edit' => ['id', 'name', 'app_id', 'app_secret', 'token', 'original_id', 'encoding_aes_key', 'company_id', 'applet_id', 'is_default'],
        'delete' => ['id'],
        'detail' => ['id'],
        'select' => ['company_id'],
    ];
}